package de.alfenory.autobill.entity;

import java.util.*;

/**
 * Orders
 * @author alefen
 */
public class Order {
    List<OrderItem> orderItemList;
    int type;
    String text;
    Date beginn;
    Date end;
    Date duedate;
    
    boolean ending;
    
    public Order(List<OrderItem> orderItemList, String text, int type, Date beginn, Date end, boolean ending) {
        this.orderItemList = orderItemList;
        this.text = text;
        this.type = type;
        this.beginn = beginn;
        this.end = end;
        this.ending = ending;
    }

    public List<OrderItem> getOrderItemList() {
        return orderItemList;
    }

    public int getType() {
        return type;
    }

    public Date getBeginn() {
        return beginn;
    }

    public Date getEnd() {
        return end;
    }

    public void setBeginn(Date beginn) {
        this.beginn = beginn;
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public void setEnding(boolean ending) {
        this.ending = ending;
    }

    public boolean isEnding() {
        return ending;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getText() {
        return text;
    }
    
    public void setText(String text) {
        this.text = text;
    }

    public Date getDuedate() {
        return duedate;
    }

    public void setDuedate(Date duedate) {
        this.duedate = duedate;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + Objects.hashCode(this.orderItemList);
        hash = 53 * hash + this.type;
        hash = 53 * hash + Objects.hashCode(this.text);
        hash = 53 * hash + Objects.hashCode(this.beginn);
        hash = 53 * hash + Objects.hashCode(this.end);
        hash = 53 * hash + Objects.hashCode(this.duedate);
        hash = 53 * hash + (this.ending ? 1 : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Order other = (Order) obj;
        if (!Objects.equals(this.orderItemList, other.orderItemList)) {
            return false;
        }
        if (this.type != other.type) {
            return false;
        }
        if (!Objects.equals(this.text, other.text)) {
            return false;
        }
        if (!Objects.equals(this.beginn, other.beginn)) {
            return false;
        }
        if (!Objects.equals(this.end, other.end)) {
            return false;
        }
        if (!Objects.equals(this.duedate, other.duedate)) {
            return false;
        }
        if (this.ending != other.ending) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Order{" + "orderItemList=" + orderItemList + ", type=" + type + ", text=" + text + ", beginn=" + beginn + ", end=" + end + ", duedate=" + duedate + ", ending=" + ending + '}';
    }
    
    
    
}